Optimal. Leaf size=51 \[ -\frac {x^2}{2}+\frac {2 e^{4 i a}}{e^{2 i a}+x^2}+2 e^{2 i a} \log \left (e^{2 i a}+x^2\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {4591, 456, 455,
45} \begin {gather*} \frac {2 e^{4 i a}}{x^2+e^{2 i a}}+2 e^{2 i a} \log \left (x^2+e^{2 i a}\right )-\frac {x^2}{2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rule 455
Rule 456
Rule 4591
Rubi steps
\begin {align*} \int x \tan ^2(a+i \log (x)) \, dx &=\int x \tan ^2(a+i \log (x)) \, dx\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(135\) vs. \(2(51)=102\).
time = 0.14, size = 135, normalized size = 2.65 \begin {gather*} -\frac {x^2}{2}+2 i \text {ArcTan}\left (\frac {\left (1+x^2\right ) \cot (a)}{-1+x^2}\right ) \cos (2 a)+\cos (2 a) \log \left (1+x^4+2 x^2 \cos (2 a)\right )-2 \text {ArcTan}\left (\frac {\left (1+x^2\right ) \cot (a)}{-1+x^2}\right ) \sin (2 a)+i \log \left (1+x^4+2 x^2 \cos (2 a)\right ) \sin (2 a)+\frac {2 \cos (3 a)+2 i \sin (3 a)}{\left (1+x^2\right ) \cos (a)-i \left (-1+x^2\right ) \sin (a)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.04, size = 42, normalized size = 0.82
method | result | size |
risch | \(-\frac {5 x^{2}}{2}+\frac {2 x^{2}}{1+\frac {{\mathrm e}^{2 i a}}{x^{2}}}+2 \,{\mathrm e}^{2 i a} \ln \left ({\mathrm e}^{2 i a}+x^{2}\right )\) | \(42\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 185 vs. \(2 (37) = 74\).
time = 0.29, size = 185, normalized size = 3.63 \begin {gather*} -\frac {x^{4} + {\left (4 \, {\left (-i \, \cos \left (2 \, a\right ) + \sin \left (2 \, a\right )\right )} \arctan \left (\sin \left (2 \, a\right ), x^{2} + \cos \left (2 \, a\right )\right ) + \cos \left (2 \, a\right ) + i \, \sin \left (2 \, a\right )\right )} x^{2} + 4 \, {\left (-i \, \cos \left (2 \, a\right )^{2} + 2 \, \cos \left (2 \, a\right ) \sin \left (2 \, a\right ) + i \, \sin \left (2 \, a\right )^{2}\right )} \arctan \left (\sin \left (2 \, a\right ), x^{2} + \cos \left (2 \, a\right )\right ) - 2 \, {\left (x^{2} {\left (\cos \left (2 \, a\right ) + i \, \sin \left (2 \, a\right )\right )} + \cos \left (2 \, a\right )^{2} + 2 i \, \cos \left (2 \, a\right ) \sin \left (2 \, a\right ) - \sin \left (2 \, a\right )^{2}\right )} \log \left (x^{4} + 2 \, x^{2} \cos \left (2 \, a\right ) + \cos \left (2 \, a\right )^{2} + \sin \left (2 \, a\right )^{2}\right ) - 4 \, \cos \left (4 \, a\right ) - 4 i \, \sin \left (4 \, a\right )}{2 \, {\left (x^{2} + \cos \left (2 \, a\right ) + i \, \sin \left (2 \, a\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.55, size = 54, normalized size = 1.06 \begin {gather*} -\frac {x^{4} + x^{2} e^{\left (2 i \, a\right )} - 4 \, {\left (x^{2} e^{\left (2 i \, a\right )} + e^{\left (4 i \, a\right )}\right )} \log \left (x^{2} + e^{\left (2 i \, a\right )}\right ) - 4 \, e^{\left (4 i \, a\right )}}{2 \, {\left (x^{2} + e^{\left (2 i \, a\right )}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.15, size = 42, normalized size = 0.82 \begin {gather*} - \frac {x^{2}}{2} + 2 e^{2 i a} \log {\left (x^{2} + e^{2 i a} \right )} + \frac {2 e^{4 i a}}{x^{2} + e^{2 i a}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 221 vs. \(2 (37) = 74\).
time = 0.58, size = 221, normalized size = 4.33 \begin {gather*} -\frac {x^{4}}{2 \, {\left (x^{2} + \frac {e^{\left (4 i \, a\right )}}{x^{2}} + 2 \, e^{\left (2 i \, a\right )}\right )}} + \frac {2 \, x^{2} e^{\left (2 i \, a\right )} \log \left (x^{2} + e^{\left (2 i \, a\right )}\right )}{x^{2} + \frac {e^{\left (4 i \, a\right )}}{x^{2}} + 2 \, e^{\left (2 i \, a\right )}} - \frac {5 \, x^{2} e^{\left (2 i \, a\right )}}{2 \, {\left (x^{2} + \frac {e^{\left (4 i \, a\right )}}{x^{2}} + 2 \, e^{\left (2 i \, a\right )}\right )}} + \frac {4 \, e^{\left (4 i \, a\right )} \log \left (x^{2} + e^{\left (2 i \, a\right )}\right )}{x^{2} + \frac {e^{\left (4 i \, a\right )}}{x^{2}} + 2 \, e^{\left (2 i \, a\right )}} - \frac {3 \, e^{\left (4 i \, a\right )}}{2 \, {\left (x^{2} + \frac {e^{\left (4 i \, a\right )}}{x^{2}} + 2 \, e^{\left (2 i \, a\right )}\right )}} + \frac {2 \, e^{\left (6 i \, a\right )} \log \left (x^{2} + e^{\left (2 i \, a\right )}\right )}{{\left (x^{2} + \frac {e^{\left (4 i \, a\right )}}{x^{2}} + 2 \, e^{\left (2 i \, a\right )}\right )} x^{2}} + \frac {e^{\left (6 i \, a\right )}}{2 \, {\left (x^{2} + \frac {e^{\left (4 i \, a\right )}}{x^{2}} + 2 \, e^{\left (2 i \, a\right )}\right )} x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.21, size = 41, normalized size = 0.80 \begin {gather*} \frac {2\,{\mathrm {e}}^{a\,4{}\mathrm {i}}}{x^2+{\mathrm {e}}^{a\,2{}\mathrm {i}}}+2\,{\mathrm {e}}^{a\,2{}\mathrm {i}}\,\ln \left (x^2+{\mathrm {e}}^{a\,2{}\mathrm {i}}\right )-\frac {x^2}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________